from apps.pdd.pdd.utils.app.core.pdd_user import PDDAppUserPool


def run():
    tt = PDDAppUserPool(redis_key="user:pdd:app", max_users_num=5, keep_alive=True)
    users = tt.users
    for user in users:
        user.refresh()
    tt.run()
    # user = tt.get_user(block=False)
    # user = tt.get_user_by_id("19303842275")
    # user.refresh()
    # logger.info("user: 【{}】：{}".format(user.username, user.user_id))
    # proxies = get_company_ip_crawler_by_api(static=True)
    # AppCrawler(cookie=user.cookies, headers=user.headers, proxies=proxies, cache_minutes=60 * 24).auto_tun(user=user)
    # AppFav({"headers": user.headers, "cookies": user.cookies, "proxies": proxies}).run_one(user=user)


if __name__ == "__main__":
    run()
